Repository navigation
Deploy Web App: build and deploy in separate jobs - #731
Conversation
deploy-pages listed the run's artifacts a fraction of a second after upload-pages-artifact finalized in the same job and found none (actions/deploy-pages#451). That failed the v1.32.0 web deploy twice, and a re-run uploads a second github-pages artifact, which deploy-pages rejects. The build job now runs the repository code with a contents: read token, and only the deploy job holds pages: write and id-token: write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M98owbb9iKsAUWvSpjCFTz
|
Reviewed the workflow split in
I only read the diff and did not run the workflow. Confirm with a |
|
Probe results, from a throwaway branch with no deploy. Each job uploaded a Pages artifact with the same
So the service lists a large artifact a short time after it reports the upload finalized. A lookup inside that window misses, and the separate deploy job is well past it. The window varies. The 10-14 and 10-20 deploys found the artifact 0.42-0.48 s after finalize, while today's three failures looked 0.32-0.44 s after. A fourth dispatch from main (45035653157) looked 0.63 s after, found it, and deployed v1.32.0 to plans.erikdarling.com. With the split, "Re-run failed jobs" re-runs only |
The v1.32.0 web deploy (Deploy Web App, run 45033007466) failed at "Deploy to GitHub Pages" with
No artifacts named "github-pages" were found. A freshworkflow_dispatchrun from main (45034693490) failed the same way. Its log shows the artifact finalized at 14:48:29.04 and deploy-pages listing the run's artifacts right after it:Found 0 artifact(s). That's actions/deploy-pages#451. When upload-pages-artifact and deploy-pages run in the same job, the lookup can come back empty for an artifact that was finalized a fraction of a second earlier.Re-running the failed job can't recover. It uploads a second
github-pagesartifact to the same run, and deploy-pages then fails withMultiple artifacts named "github-pages"(run 45033007466, attempt 2).Change
deploy-web.ymlis split into two jobs, the layout GitHub's other Pages starter workflows use:build: checkout, .NET, WASM publish, the.nojekyll/CNAME/404.htmlsteps, andupload-pages-artifact. It has the workflow's top-levelcontents: readtoken, so the job that runs repository code no longer holdspages: writeorid-token: write.deploy(needs: build):deploy-pagesonly, withcontents: read,pages: writeandid-token: write(the same set the single job had), in thegithub-pagesenvironment.Triggers, concurrency, action pins and every build step are unchanged.
Reaching the live site
The
github-pagesenvironment deploys only frommain, so this takes effect with the next release. Until then, aworkflow_dispatchrun from main can still hit the race. plans.erikdarling.com keeps serving the v1.31.0 build until a deploy succeeds.🤖 Generated with Claude Code
https://claude.ai/code/session_01M98owbb9iKsAUWvSpjCFTz